package com.itly.rwmlj.controller;

import com.itly.rwmlj.pojo.Code;
import com.itly.rwmlj.pojo.ParamPage;
import com.itly.rwmlj.pojo.Result;
import com.itly.rwmlj.pojo.paramTemp;
import com.itly.rwmlj.service.VisualService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: 罗言
 * @Version: 1.0
 * @Date: 2024-01-20-17:29
 * @Description:
 */
@Controller
@RequestMapping("/vis")
public class VisualController {

    @Autowired
    private VisualService service;

    @PostMapping("/data1")
    @ResponseBody
    public Result getData1(@RequestBody paramTemp param) {
        List<paramTemp> data = service.getData1(param.getParam());
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @PostMapping("/data2")
    @ResponseBody
    public Result getData2() {
        List<paramTemp> data = service.getData2();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @PostMapping("/data3")
    @ResponseBody
    public Result getData3(@RequestBody paramTemp param) {
        List<paramTemp> data = service.getData3(param.getParam(), param.getParam1());
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @PostMapping("/data4")
    @ResponseBody
    public Result getData4(@RequestBody paramTemp param) {
        List<paramTemp> data = service.getData4(param.getParam(), param.getParam1());
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @PostMapping("/data5")
    @ResponseBody
    public Result getData5(@RequestBody paramTemp param) {
        List<paramTemp> data = service.getData5(param.getParam(), param.getParam1());
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @PostMapping("/data6")
    @ResponseBody
    public Result getData6(@RequestBody ParamPage page) {
        List<paramTemp> data = service.getData6(page.getStart(), page.getSize());
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data7")
    @ResponseBody
    public Result getData7() {
        List<paramTemp> data = service.getData7();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data8")
    @ResponseBody
    public Result getData8() {
        List<paramTemp> data = service.getData8();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data9")
    @ResponseBody
    public Result getData9() {
        List<paramTemp> data = service.getData9();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data10")
    @ResponseBody
    public Result getData10() {
        List<paramTemp> data = service.getData10();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data11")
    @ResponseBody
    public Result getData11() {
        List<paramTemp> data = service.getData11();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data12")
    @ResponseBody
    public Result getData12() {
        List<paramTemp> data = service.getData12();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data13")
    @ResponseBody
    public Result getData13() {
        List<paramTemp> data = service.getData13();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data14")
    @ResponseBody
    public Result getData14() {
        List<paramTemp> data = service.getData14();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

}
